import time
import asyncio
import functools
now = lambda: time.time()

start = now()
async def doSomeWork(x):
	print('Waiting: ', x)
	return 'Done after {}s'.format(x)

def callBack(t,future):
	print('Callback', t,future.result())

coroutine = doSomeWork(2)
loop = asyncio.get_event_loop()
task = asyncio.ensure_future(coroutine)
task.add_done_callback(functools.partial(callBack, 2))
loop.run_until_complete(task)
print('TIME: ', now() - start)